#include "sup_h/httplib.h"
#include <iostream>

using namespace std;

#define SERVER_IP "43.138.197.98"
#define SERVER_PORT 9090

int main(){

    httplib::Client client(SERVER_IP,SERVER_PORT);

    httplib::MultipartFormData item;
    //要和server端的名字对应    auto ret = req.has_file("file");
    //设置item名称
    item.name = "file";
    //获取文件名称
    item.filename = "hello.txt";
    //获取文件数据
    item.content = "Hello world!";
    item.content_type = "text/plain";

    //将item添加到vector中
    httplib::MultipartFormDataItems items;
    items.push_back(item);

    //请求服务器，和服务器对应  server.Post("/multipart", Multipart);
    //                      请求         要提交的数据
    auto res = client.Post("/multipart", items);
    cout << res->status << endl;
    cout << res->body << endl;

    return 0;
}